package com.suray.system.run.core;

import lombok.Data;

import java.util.Date;
import java.util.Objects;

@Data
public class LowBatteryDescription extends BaseInfo {

    /**
     * 低电量时的（单次）最低电量值
     */
    private int batSoc;

    /**
     * 低电量标定值
     */
    private int markLowSoc;

    /**
     * 低电量开始时间
     */
    private Date lowTime;

    /**
     * 低电量恢复时间
     */
    private Date recoverTime;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LowBatteryDescription that = (LowBatteryDescription) o;
        return batSoc == that.batSoc &&
                markLowSoc == that.markLowSoc &&
                Objects.equals(lowTime, that.lowTime) &&
                Objects.equals(recoverTime, that.recoverTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), batSoc, markLowSoc, lowTime, recoverTime);
    }
}
